<?php
namespace Teemo\MVC;

/**
 * Created by PhpStorm.
 * User: lkk
 * Date: 2019/1/15
 * Time: 6:31 PM
 */
class Entity
{
    /**
     * Entity constructor.
     *
     * @param array $array
     *
     * @desc 把数组填充到entity
     */
    public function __construct(array $array)
    {
        if (empty($array)) {
            return $this;
        }
        foreach ($array as $key => $value) {
            if (property_exists($this, $key)) {
                $this->$key = $value;
            }
        }
    }
}